package com.jk.dmshopprovider.controller;

import com.jk.dmcommon.entity.TicketEntity;
import com.jk.dmcommon.entity.YeWuEntity;
import com.jk.dmshopprovider.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 赵优秀
 * @version 1.0.0
 * @ClassName ShopControoler.java
 * @Description TODO
 * @createTime 2021年09月09日 16:51:00
 */
@RestController
@RequestMapping("shop")
public class ShopControoler {

    @Autowired
    private ShopService shopService;
    /**
     * @title 查询活动介绍
     * @description
     * @author 刘卧龙
     * @updateTime 2021/9/10 10:57
     * @throws
     */
    @RequestMapping("findShop")
    public Object findShop(@RequestParam("goodsId") Integer goodsId){
        return  shopService.findShop(goodsId);
    }
    @RequestMapping("getCoupon")
    public List<TicketEntity> getCoupon(){
        return shopService.getCoupon();
    }

    @PostMapping("buy")
    public Object buy(@RequestBody YeWuEntity yeWuEntity){
        return shopService.buy(yeWuEntity);
    }

    @PostMapping("affirmBuy")
    public Object affirmBuy(@RequestBody YeWuEntity yeWuEntity){
        return shopService.affirmBuy(yeWuEntity);
    }

    //座位信息存redis
    @RequestMapping("zuowei")
    public void zuowei(@RequestParam String site){
        shopService.zuowei(site);
    }
    /**
    *  @方法描述 (生成座位)
     * @Author 王乐
     * @Description //TODO 
     * @Date  2021/9/20 9:59
     * @Param [id]
     * @return java.lang.String
     **/
    @RequestMapping("createSite")
    public String createSite(Integer id){
        return shopService.createSite(id);
    }
    /**
    *  @方法描述 (提交选座)
     * @Author 王乐
     * @Description //TODO 
     * @Date  2021/9/20 17:42
     * @Param [siteArr]
     * @return java.lang.String
     **/
    @RequestMapping("subSite")
    public String subSite(String siteArr,Integer id){
        return shopService.subSite(siteArr,id);
    }

}
